//
//  def_parameter_declaration.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_parameter_declaration_h
#define compilation_def_parameter_declaration_h

/*
 parameter_declaration
 : type_name declarator {printf("parameter_declaration\n");}
 ; 
 */

struct def_parameter_declaration{
	void * parent;
	int type;
	enum type type_name;
	struct def_declarator * declarator;
	
	struct symbol * _symbols[255];
	int _count;
};

struct def_parameter_declaration * parameter_declaration_create(void * parent){
	struct def_parameter_declaration * s = malloc(sizeof(*s));
	s->type = 0;
	s->parent = parent;
	s->_count=0;
	return s;
}

void parameter_declaration_print(struct def_parameter_declaration * p){
	switch(p->type){
		case 1:
			type_print(p->type_name);
			declarator_print(p->declarator);
	}
}

void parameter_declaration_add_symbol(struct def_parameter_declaration *p, struct symbol * s){
	p->_symbols[p->_count] = s;
	p->_count++;
}
#endif
